home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1999 #3 / Amiga Plus CD - 1999 - No. 3.iso / Anwender / Fonts / Viewfonts2 / Install_VF2 next >
Text File  |  1994-01-26  |  4KB  |  121 lines

  1. ; $VER: Viewfonts 2 installer 2/2/97 by David McMinn
  2. (set @default-dest "Workbench:Tools")
  3. (set @default-src (pathonly @icon))
  4.  
  5.  
  6. ; Set minimum requirements for Viewfonts 2
  7. (set #min_osversion 36)
  8.  
  9.  
  10. ; Set all the strings to what they would be in english.
  11. (set #abort_osversion  ("Your version of Workbench is too old to use with %s.\n\n\nAborting install." @appname))
  12. (set #prompt_reqtools  "Copying reqtools.library v38.1210")
  13. (set #prompt_drawer    "Program and help file installation destination")
  14. (set #abort_samedir    "Cannot install to source directory, aborting.")
  15. (set #prompt_MWBicons  "Do you want to use MagicWB style icons?")
  16. (set #help_MWBicons    "If you have installed either MagicWB (MWB) or ")
  17. (set #help_MWBicons (cat #help_MWBicons "Magic User Interface (MUI), then you will probably want"))
  18. (set #help_MWBicons (cat #help_MWBicons " to use these icons instead of the standard ones. To "))
  19. (set #help_MWBicons (cat #help_MWBicons "copy these icons instead of the standard ones select "))
  20. (set #help_MWBicons (cat #help_MWBicons "`Yes' but if you want to keep the standard icons, "))
  21. (set #help_MWBicons (cat #help_MWBicons "select `No'."))
  22. (set #prompt_copyprog  "Copying program and icon")
  23. (set #prompt_copyhelp  "Copying help file and icon")
  24. (set #abort_trapuser   "You have aborted installation, quitting.")
  25.  
  26.  
  27. ; Any other languages should be inserted here, like the example
  28. (if (= @language "deutsch")
  29. ; Strings set in here
  30. )
  31.  
  32.  
  33. ; Check for minimum requirements
  34. (set osversion  (/ (getversion) 65536) )
  35. (set osrevision (- (getversion) (* osversion 65536) ) )
  36. (if (< osversion #min_osversion) (exit abort_osversion) )
  37.  
  38.  
  39. ; Copy reqtools.library to LIBS: unless there is a newer version there
  40. ; already, but only if it exists in the source path.
  41. (copylib
  42.   (prompt #prompt_reqtools)
  43.   (help @copylib-help)
  44.   (source "reqtools.library")
  45.   (dest "LIBS:")
  46.   (confirm)
  47. )
  48.  
  49.  
  50. ; Get destination drawer for program and help files. Check for users pressing
  51. ; the abort install button in the askdir thing. The way I have it set up to
  52. ; go to @default-dest makes it tricky to use trap 1, but if the user aborts
  53. ; askdir returns an abort which cause a script error when you try to assign
  54. ; it to a @ type variable
  55. (if (trap 3
  56.     (set @default-dest (askdir
  57.         (prompt #prompt_drawer)
  58.         (help @askdir-help)
  59.         (default @default-dest)
  60.         (newpath)
  61.     ))
  62. ) (exit #abort_trapuser (quiet)))
  63.  
  64.  
  65. ; Make sure that destination drawer selected is not same as
  66. ; source directory
  67. (if (= @default-dest @default-src) (exit #abort_samedir))
  68.  
  69.  
  70. ; Ask user if they want to install MWB icons or use the standard ones
  71. (set flag (askbool
  72.     (prompt #prompt_MWBicons)
  73.     (help #help_MWBicons)
  74. ))
  75.  
  76.  
  77. ; Copy main program executable and appropriate icon
  78. (if flag                                            ; If MWB icons selected
  79.     (set icon_file "Viewfonts2_MWB/Viewfonts2.info"); Copy MWB icon
  80.     (set icon_file "Viewfonts2.info")                ; Else copy standard icon
  81. )
  82. (copyfiles
  83.     (prompt #prompt_copyprog)
  84.     (help @copyfile-help)
  85.     (source @default-src)
  86.     (choices "Viewfonts2" icon_file)
  87.     (dest @default-dest)
  88.     (files)
  89.     (confirm)
  90. )
  91.  
  92.  
  93. ; Copy help file and appropriate icon
  94. (if flag                                                    ; If MWB icons selected
  95.     (set icon_file "Viewfonts2_MWB/Viewfonts2.guide.info")    ; Copy MWB icon
  96.     (set icon_file "Viewfonts2.guide.info")                    ; Else copy standard icon
  97. )
  98. (copyfiles
  99.   (prompt #prompt_copyhelp)
  100.   (help @copyfile-help)
  101.   (source @default-src)
  102.   (choices "Viewfonts2.guide" icon_file)
  103.   (dest @default-dest)
  104.   (files)
  105.   (confirm)
  106. )
  107.  
  108.  
  109. ; Copy MWB drawer icon if a new drawer was created (best guess at if a new
  110. ; drawer was created was to check if the destination path contained `viewfont')
  111. (if (patmatch "#?viewfont#?" @default-dest)
  112.     (copyfiles
  113.         (prompt "Copying MWB drawer image")
  114.         (help @copyfile-help)
  115.         (source "Viewfonts2_MWB.info")
  116.         (dest @default-dest)
  117.         (newname (cat @default-dest ".info"))
  118.         (confirm)
  119.     )
  120. )
  121.